/**
 * Created by flove on 2017/4/28.
 */

$(function(){
 function seladapterview() {
     var data1=[
         {
             id:"1",
             name:"王以南",
             sex:"女",
             date:"1993-5-16",
             type:"外科",
             money:"200",
             time:"2017-3-4",
             Jid:"3"
         },
         {
             id:"2",
             name:"王以南",
             sex:"女",
             date:"1993-5-16",
             type:"外科",
             money:"200",
             time:"2017-3-4",
             Jid:"3"
         },
         {
             id:"3",
             name:"王以南",
             sex:"女",
             date:"1993-5-16",
             type:"外科",
             money:"200",
             time:"2017-3-4",
             Jid:"3"
         },
         {
             id:"4",
             name:"王以南",
             sex:"女",
             date:"1993-5-16",
             type:"外科",
             money:"200",
             time:"2017-3-4",
             Jid:"3"
         }, {
             id:"5",
             name:"王以南",
             sex:"女",
             date:"1993-5-16",
             type:"外科",
             money:"200",
             time:"2017-3-4",
             Jid:"3"
         },
         {
             id:"6",
             name:"王以南",
             sex:"女",
             date:"1993-5-16",
             type:"外科",
             money:"200",
             time:"2017-3-4",
             Jid:"3"
         },
         {
             id:"7",
             name:"王以南",
             sex:"女",
             date:"1993-5-16",
             type:"外科",
             money:"200",
             time:"2017-3-4",
             Jid:"3"
         },
         {
             id:"8",
             name:"王以南",
             sex:"女",
             date:"1993-5-16",
             type:"外科",
             money:"200",
             time:"2017-3-4",
             Jid:"3"
         },
         {
             id:"9",
             name:"王以南",
             sex:"女",
             date:"1993-5-16",
             type:"外科",
             money:"200",
             time:"2017-3-4",
             Jid:"3"
         }

     ];

     console.log(this.current);
     var step=this.pagesize;
     var data=data1.slice((this.current-1)*step,this.current*step);
     console.log(data);

     $(".table").empty();
     var s_title="<tr><th>ID</th><th>患者姓名</th><th>性别</th><th>出生日期</th><th>交易类型</th><th>虚拟币金额</th><th>时间</th><th>监护人ID</th></tr>";

     $(".table").append(s_title);
     $.each(data,function (index,ele) {
         var html="";
         html+="<tr><td>"+ele.id+"</td><td>"+ele.name+"</td><td>"+data[index].sex+"</td><td>"+data[index].date+"</td><td>"+data[index].type+"</td><td>"+data[index].money+"</td><td>"+data[index].time+"</td><td>"+data[index].Jid+"</td></tr>";
         $(".table").append(html);
     });

 }
   /* $.ajax({
        type:"post",
        url:"",
        dataType:"json",
        data:{
           page:
           pageCount:7
        }
        success:function (data) {
            $(".table").empty();
            var s_title="<tr><th>ID</th><th>患者姓名</th><th>性别</th><th>出生日期</th><th>交易类型</th><th>虚拟币金额</th><th>时间</th><th>监护人ID</th></tr>";

            $(".table").append(s_title);
            $.each(data,function (index,ele) {
                var html="";
                html+="<tr><td>"+data[index].id+"</td><td>"+data[index].name+"</td><td>"+data[index].sex+"</td><td>"+data[index].date+"</td><td>"+data[index].type+"</td><td>"+data[index].money+"</td><td>"+data[index].time+"</td><td>"+data[index].Jid+"</td></tr>";
                $(".table").append(html);
            });
        }
    })*/



Window.seladapterview;

});